#include "oGamePreDefine.h"
#include "oGameKeyboard.h"

void oInputKey::selected()
{
	CCMenuItemImage::selected();
	oKeyboard::updateKey(_key, true);
}

void oInputKey::unselected()
{
	CCMenuItemImage::unselected();
	oKeyboard::updateKey(_key, false);
}

oInputKey* oInputKey::create( uint8 key, const char* imageUp, const char* imageDown )
{
	oInputKey* item = new oInputKey();
	item->_key = key;
	CCNode* normalSprite = CCSprite::spriteWithFile(imageUp);
	CCNode* selectedSprite = CCSprite::spriteWithFile(imageDown);
	item->initFromNormalSprite(normalSprite, selectedSprite, NULL, NULL, NULL); 
	item->autorelease();
	return item;
}
